<?php

/**
 * @author @author Samrat Khan & Sadik Sarfaraz - May 25, 2013
 */

/**
 * junkRemover
 * 
 * @param string $name Delete junk entry from a table
 * @param string $db Database Connection String
 * 
 */
function junkRemover($tblname, $db) {
    $query = "DELETE FROM ".$tblname." WHERE junkentry = 0";
    try {
        $stmt = $db->prepare($query);
        $stmt->execute();
    } catch (PDOException $ex) {
        die("Failed to run query: " . $ex->getMessage());
    }
}
?>
